{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "265dc679",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[1. 0. 1. 0. 1. 0. 1. 0.]\n",
      " [0. 1. 0. 1. 0. 1. 0. 1.]\n",
      " [1. 0. 1. 0. 1. 0. 1. 0.]\n",
      " [0. 1. 0. 1. 0. 1. 0. 1.]\n",
      " [1. 0. 1. 0. 1. 0. 1. 0.]\n",
      " [0. 1. 0. 1. 0. 1. 0. 1.]\n",
      " [1. 0. 1. 0. 1. 0. 1. 0.]\n",
      " [0. 1. 0. 1. 0. 1. 0. 1.]]\n",
      "34.280441754951525\n",
      "0.5356319024211176\n",
      "1.240571174528175\n",
      "4.393770757714734\n",
      "-2.3816659403310383\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "from numpy import random, mat\n",
    "\n",
    "#1\n",
    "arr = np.zeros((8, 8))\n",
    "#2\n",
    "arr[1::2, 1::2] = 1\n",
    "arr[0::2, 0::2] = 1\n",
    "print(arr)\n",
    "#3\n",
    "arr1 = np.random.randn(8, 8) + arr\n",
    "\n",
    "print(arr1.sum())\n",
    "print(arr1.mean())\n",
    "print(arr1.std())\n",
    "print(arr1.max())\n",
    "print(arr1.min())\n",
    "\n",
    "#4\n",
    "matr1=mat(arr1)\n",
    "matr2 = matr1.T\n",
    "#5\n",
    "np.save('matr2.npy', matr2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "d79d70ff",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 1.80764698, -0.78878235,  1.23608957,  0.53636288,  1.42847099,\n",
       "        -0.59152919, -1.53695498,  0.46873185],\n",
       "       [-1.68592262,  1.42095562, -0.33229848,  0.38198591, -0.21499427,\n",
       "         2.15841144, -0.27528413,  0.01836432],\n",
       "       [ 2.08612967,  0.82715206, -0.38731945,  0.38782887,  1.1974177 ,\n",
       "        -0.20951125,  0.6004133 , -1.40587234],\n",
       "       [-0.31533721, -1.43172127, -0.2412993 ,  1.46891841,  0.85620619,\n",
       "         0.45965474,  1.23255388,  2.03103772],\n",
       "       [ 2.65535741,  0.57083788,  1.78418771, -1.12322103,  1.19621653,\n",
       "         1.20738221,  1.63047325,  1.86089202],\n",
       "       [-0.70232506,  2.27945043,  0.43817993,  1.02869852,  0.63688753,\n",
       "         2.47364573, -0.26571907,  0.437394  ],\n",
       "       [ 0.55049276, -2.13928171,  0.25931113, -0.79210765, -1.42710153,\n",
       "         0.45662174,  1.17097961,  0.92705189],\n",
       "       [-1.25324986,  1.29635793,  0.34358774,  0.80846425,  0.49374671,\n",
       "         1.5312049 , -0.39297506,  0.48288446]])"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a =np.load('matr2.npy')\n",
    "a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1c622b1a",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
